<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>取消订单</title>
</head>
<body>
    <a href="/home/" class="button">返回</a>
    <h1>失败订单管理</h1>
    {% if messages %}
        <ul class="messages">
            {% for message in messages %}
                <li {% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
            {% endfor %}
        </ul>
    {% endif %}

    <form action="/return/" method="post">
        {% csrf_token %}
        <button type="submit" name="action" value="3">取消订单</button>
        <button type="submit" name="action" value="4">查询所有已取消订单</button>
        <div class="container mt-5">
            <h2>取消订单</h2>
            <form action="/return/" method="post">
                {% csrf_token %}
                <div class="mb-3">
                    <label for="id_orderid" class="form-label">订单号</label>
                    {{ form.orderid.errors }}
                    {{ form.orderid }}
                </div>
            </form>
        </div>
    </form>
    {% if returnorders %}
        {% for returnorder in returnorders %}
            <p><strong>取消订单:</strong> {{ returnorder.orderid }}</p>
            <p><strong>处理状态:</strong> {{ returnorder.status }}</p>
        {% endfor %}
    {% endif %}
</body>
</html>

